package com.mjkj.controller;

import com.mjkj.core.result.Result;
import com.mjkj.core.result.ResultGenerator;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Tag(name = "ConfigController", description = "配置中心")
@RefreshScope
public class ConfigController {

    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/config")
    @Operation(summary = "获取配置信息")
    public Result getConfig() {
        return ResultGenerator.genSuccessResult( "config.info: " + configInfo);
    }
}
